/**
 * Created by thomas on 2017/5/2.
 */
import React,{Component} from 'React';
import  Tacos from  './Tacos'
// import Bus from 'bundle-loader?lazy!./Bus'
// import Cart from 'bundle-loader?lazy!./Cart'
import Bundle from './Bundle';
// import Height from 'bundle-loader?lazy!./Height'
// import Age from 'bundle-loader?lazy!./get_age';
// import Record from './Record'
import Loading from  './loading_page';
import Push_img from  'bundle-loader?lazy!./push_img';
import LoadDashboard from 'bundle-loader?lazy!./Record.js';
import SandW from 'bundle-loader?lazy!./Sandwiches.js';
const createComponent = (component) =>() => (
    <Bundle load={component}>
        {
            (Component) => Component? <Component/> : <Loading/>
        }
    </Bundle>
)
// console.log(createComponent(LoadDashboard))
// Sandwiches
const Routes = [
    { path: '/sandwiches',
        component: createComponent(SandW)
    },
    { path: '/record',
        component:createComponent(LoadDashboard)
    },
    { path: '/push_img',
        component: createComponent(Push_img)
    },
    { path: '/tacos',
        component: Tacos,
        routes: [
            // { path: '/tacos/bus',
            //     component: createComponent(Bus)
            // },
            // { path: '/tacos/cart',
            //     component: createComponent(Cart)
            // },
            // {   path: '/tacos/age',
            //     component: createComponent(Age)
            // },
            // {path: '/tacos/age',
            //     component: createComponent(Height)
            // }
        ]
    }
]
export default Routes;
